package com.gaohe.scp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.scp.mapper.CsCarSituationMapper;
import com.gaohe.scp.domain.CsCarSituation;
import com.gaohe.scp.service.ICsCarSituationService;

/**
 * 车况信息Service业务层处理
 *
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Service
public class CsCarSituationServiceImpl implements ICsCarSituationService
{
    @Autowired
    private CsCarSituationMapper csCarSituationMapper;


    @Override
    public CsCarSituation selectCsCarSituationByCarId(Long carId)
    {
        return csCarSituationMapper.selectCsCarSituationByCarId(carId);
    }

    @Override
    public List<CsCarSituation> selectCsCarSituationListByCarId(Long carId) {
        return csCarSituationMapper.selectCsCarSituationListByCarId(carId);
    }

    /**
     * 查询车况信息
     *
     * @param situationId 车况信息主键
     * @return 车况信息
     */
    @Override
    public CsCarSituation selectCsCarSituationBySituationId(Long situationId)
    {
        return csCarSituationMapper.selectCsCarSituationBySituationId(situationId);
    }

    /**
     * 查询车况信息列表
     *
     * @param csCarSituation 车况信息
     * @return 车况信息
     */
    @Override
    public List<CsCarSituation> selectCsCarSituationList(CsCarSituation csCarSituation)
    {
        return csCarSituationMapper.selectCsCarSituationList(csCarSituation);
    }

    /**
     * 新增车况信息
     *
     * @param csCarSituation 车况信息
     * @return 结果
     */
    @Override
    public int insertCsCarSituation(CsCarSituation csCarSituation)
    {
        csCarSituation.setCreateTime(DateUtils.getNowDate());
        return csCarSituationMapper.insertCsCarSituation(csCarSituation);
    }

    /**
     * 修改车况信息
     *
     * @param csCarSituation 车况信息
     * @return 结果
     */
    @Override
    public int updateCsCarSituation(CsCarSituation csCarSituation)
    {
        csCarSituation.setUpdateTime(DateUtils.getNowDate());
        return csCarSituationMapper.updateCsCarSituation(csCarSituation);
    }

    /**
     * 批量删除车况信息
     *
     * @param situationIds 需要删除的车况信息主键
     * @return 结果
     */
    @Override
    public int deleteCsCarSituationBySituationIds(Long[] situationIds)
    {
        return csCarSituationMapper.deleteCsCarSituationBySituationIds(situationIds);
    }

    /**
     * 删除车况信息信息
     *
     * @param situationId 车况信息主键
     * @return 结果
     */
    @Override
    public int deleteCsCarSituationBySituationId(Long situationId)
    {
        return csCarSituationMapper.deleteCsCarSituationBySituationId(situationId);
    }
}
